#include<iostream>
#include<ctime>
const int N = 1e6 + 10;
int a[N];
using namespace std;
int get_random(int left, int right)
{
	return a[rand() % (right - left + 1) + left];
}
void quick_sort(int left, int right)
{
	if (left >= right) return;
	int t = get_random(left, right);
	int l = left - 1, r = right + 1,cur = left;
	while (cur < r)
	{
		if (a[cur] > t) swap(a[cur], a[--r]);
		else if (a[cur] < t) swap(a[cur++], a[++l]);
		else cur++;
	}
	quick_sort(left,l);
	quick_sort(r, right);
}
int main()
{
	srand(time(0));
	int n;cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	quick_sort(1, n);
	for (int i = 1; i <= n; i++)
	{
		cout << a[i] << ' ';
	}
	return 0;
}